<!DOCTYPE html>
<html ng-app="smartOlwApp">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>Sede</title>
		<link rel="stylesheet" type="text/css" href="../../css/smart_icons_styles.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_menu.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_general.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_tabladatos.css">
	  	
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog.css">
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-default.css">
		<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-plain.css">
	  	
        <!-- Importarmos angular JS -->
        <script type="text/javascript" src="../../js/jquery/jquery-1.8.3.min.js"></script>
    	<script type="text/javascript" src="../../js/main/template.js"></script>
    	<script type="text/javascript" src="../../js/angular-1.4.7/angular.min.js"></script>
    	<script type="text/javascript" src="../../js/ngdialog-0.2.3/ngDialog.min.js"></script> 
    	
    	<!-- importar script para las funciones del formulario -->
    	<script type="text/javascript" src="../smart_maestros/script/maestro_app.js"></script>
		<script type="text/javascript" src="../smart_maestros/script/maestro_service.js"></script>
		<script type="text/javascript" src="script/sede_controller.js"></script>
		
</head>
</head>
<body ng-controller="sedeCtrl">
			<div class="col-md-10" id="frame">
		<div class="panel panel-primary ng-scope">
   
		    <div class="panel-heading">Sede
		 	<a href="#"><span class="img"><img src="../../imagene/eliminar.png" style="float:right;"  ng-click="eliminar(sede)" title = "Eliminar sedes"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/limpiar.png" style="float:right;"   ng-click="limpiar(sede)" title= "Limpiar"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/consultar.png" style="float:right;" ng-click="consultar(sede)" title= "Consultar sede"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/guardar.png" style="float:right;"   ng-click="grabar(sede)" title= "Guardar sede"></span></a>
		  </div>
		  <div class="panel-body">
		   <input id="scsede" type="text" class="texto" ng-model="sede.scsede" style = "display:none;">
               
                <div class = "alert alert-danger alert-dismissable" id="messageBox">
                	<h4>{{titulo_mensajes}}</h4> {{descripcion_mensajes}}
                	<a href="#"><span class="imagen"><img src="../../imagene/bombilla-incandescente32.png"  ng-click="showModal()"></span></a>
				</div>
					<div class="col-md-10 panel panel-primary ng-scope"  style="height: 300px;">
						<table style="width:100%; vertical-align: middle;"">
							<tr style = "vertical-align: middle;">
								<td width="25%" height="100%">
									<label>País*</label><br/>
									<select  id="dspais" class="seleccion" ng-model="pais" ng-options="option.scpais as option.dspais for option in paises" ng-change="cargarDepartamentos(pais)">
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>	
								<td>
									<label class="" >Departamento*</label><br/>	
									<select class="seleccion" id="dsdepartamento" style="width:240px;" ng-options="option.scdepartamento as option.dsdepartamento for option in departamentos" ng-model="departamento" 
									ng-change ="cargarCiudades(departamento)">
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>
								<td>
									<label class="" >Ciudad*</label><br/>	
									<select class="seleccion" id="dsCiudad" style="width:240px;" ng-model="sede.smScciudad" ng-options="option.scciudad as option.dsciudad for option in ciudades" 
									 ng-change ="cargarInstitucion(sede.smScciudad)">
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>
								<td>
									<label class="" for="dsInstitucion">Instituci&oacute;n*</label><br/>	
									<select class="seleccion" id="dsInstitucion" style="width:240px;" ng-model="sede.smartInstitucion" ng-options="option.scinstitucion as option.dsinstitucion for option in instituciones" 
									>
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>
							</tr>							
							<tr>
							
							<td>
									<label for="smCosede" class="" >C&oacute;digo*</label><br/>	
									<input id="smCosede" type="text" style="width:240px;" ng-model="sede.smCosede" class="texto">
							</td>
								
									
								<td>
									<label class="" for="nit">Nombre*</label><br/>	
									<input id="smDssede" type="text" style="width:240px;" ng-model="sede.smDssede" class="texto">
								</td>

								<td>
									<label for="dszona"  class="" >Tipo Zona*</label><br/>	
									<select class="seleccion" id="dszona" style="width:240px;" ng-model="sede.smartSedeTipoZona" 
									ng-options="option.scdatmestro as option.dsdatmaestro for option in tipoZona">
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>
								
								<td>
									<label for="dsUbicacion"  class="" >Tipo Ubicaci&oacute;n*</label><br/>	
									<select class="seleccion" id="dsUbicacion" style="width:240px;" ng-model="sede.smartSedeTipoUbicacion" 
									ng-options="option.scdatmestro as option.dsdatmaestro for option in tipoUbicacion">
									  <option value="Seleccionar">Seleccionar</option>
									</select>
								</td>
								
							</tr>
							<tr>
								<td>
									<label class="" for="Telefono 1">Telefono*</label><br/>	
									<input id="Telefono 1" type="text" style="width:250px;" class="texto" ng-model="sede.smDstelefono" type="text">
								</td>
								<td>
									<label class="" for="Telefono 1">Celular*</label><br/>	
									<input id="Telefono 1" type="text" style="width:250px;" class="texto" ng-model="sede.smDscelular" type="text">
								</td>	
								<td>
									<label class="" for="Email">Email*</label><br/>	
									<input id="Email" type="text" style="width:265px;" ng-model="sede.smDsemail" class="texto">
								</td>
								<td>
									<label class="" for="sitioWeb">Sitio Web*</label><br/>	
									<input id="sitioWeb" type="text" style="width:240px;" ng-model="sede.smDssitioweb" class="texto">
								</td>
							</tr>
							<tr>
							 <td>
							   <label class="" for="direccion">Direcci&oacute;n*</label><br/>	
							   <input id="direccion" type="text" style="width:250px;" class="texto" ng-model="sede.smDsdireccion" class="texto">
							  </td> 
							</tr>
						</table>
					</div>
					<div class="container">				
					<table class = "tabledatos">
							<thead>
								<tr>
									<th style="width: 150px;" scope="col" >País*</th>
									<th style="width: 150px;" scope="col" >Departamento</th>
									<th style="width: 250px;" scope="col" >Municipio</th>
									<th style="width: 350px;" scope="col" >Nombre Oficial</th>
									<th style="width: 150px;" scope="col" >Sede</th>
									<th style="width: 150px;" scope="col" >Zona</th>
									<th style="width: 50px;" scope="col" >Sector</th>
									<th style="width: 150px;" scope="col" >Direccion</th>
									<th style="width: 150px;" scope="col" >Telefono</th>
									<th style="width: 150px;" scope="col" >Email</th>
									<th style="width: 50px;" scope="col" >Acción</th>
								</tr>
							</thead>
							<tbody class="tbody">
								<tr ng-show="sedes.length == 0">
									<th colspan="11" style="text-align:center;">
										No se encontraron sede seleccionadas
									</th>
								</tr>
							
								<tr ng-repeat="d in sedes | orderBy : 'dssede'">

									    <td style = "display:none;">
										  {{d.scsede}}
										</td>
										<td style="width: 150px;">
										  {{d.smScciudad.departamentodto.scpais.dspais}}
										</td>
										<td style="width: 150px;">
										  {{d.smScciudad.departamentodto.dsdepartamento}}
										</td>
										<td style ="width: 250px;">
										  {{d.smScciudad.dsciudad}}
										</td>	
										<td style="width: 350px;">
										  {{d.smartInstitucion.dsinstitucion}}
										</td>
										<td style="width: 150px;">
										  {{d.smDssede}}
										</td>		
										<td style="width: 350px;">
										  {{d.smartSedeTipoZona.dsdatmaestro}}
										</td>		
										 <td style = "width: 250px;">
										  {{d.smartSedeTipoUbicacion.dsdatmaestro}}
										</td>
										<td style="width: 350px;">
										  {{d.smDsdireccion}}
										</td>		
										<td style="width: 250px;">
										  {{d.smDstelefono}}
										</td>
										<td style="width: 150px;">
										  {{d.smDsemail}}
										</td>
										<td class="botonera-table" style="width: 50px;">
										<a href="#"><span class="img"><img src="../../imagene/verifique-signo24.png" style="float:center;" ng-click="seleccionar(d)" title ="Editar"></span></a>
										</td>						
								</tr>
							</tbody>
						</table>
						</div>
  
  </div>
</div> 
</div>
</body>
</html>